color editor: make popups toggleable
authorMatthias Clasen <mclasen@redhat.com>
Sun, 14 Jun 2015 02:32:05 +0000 (22:32 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 14 Jun 2015 02:32:05 +0000 (22:32 -0400)
The popups on the color editor are somewhat hard to get rid of.
Arrange things so that clicking the same control again dismisses
the current popup.

gtk/gtkcoloreditor.c

index 6eabba71af6811b1066fbc6cbc309101bd2e5313..8fbc8d5dbccd6cb44a9b8d2c82672e9c310d4e20 100644 (file)
@@ -202,7 +202,9 @@ popup_edit (GtkWidget      *widget,
       focus = editor->priv->a_entry;
     }
 
-  if (popup)
+  if (popup == editor->priv->current_popup)
+    dismiss_current_popup (editor);
+  else if (popup)
     {
       dismiss_current_popup (editor);
       toplevel = gtk_widget_get_toplevel (GTK_WIDGET (editor));